define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'collage/index',
        add_url: 'collage/add',
        edit_url: 'collage/edit',
        delete_url: 'collage/delete',
        export_url: 'collage/export',
        modify_url: 'collage/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'goods.good_name', title: '商品名称'},
                    {field: 'collage_name', title: '拼团商品名称'},
                    {field: 'collage_company', title: '拼团几件'},
                    {field: 'collage_start', title: '拼团开始时间'},
                    {field: 'collage_end', title: '拼团结束时间'},
                    {field: 'collage_prescription', title: '拼团时效'},
                    {field: 'collage_numbers', title: '拼团人数'},
                    {field: 'collage_quantity', title: '拼团数量'},
                    {field: 'collage_sort', title: '拼团排序'},
                    {field: 'collage_freight', title: '运费模板0包邮1不包邮'},
                    {field: 'collage_type', title: '拼团状态0关闭1开启'},
                    {field: 'create_time', title: 'create_time'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});